package com.csii.ams.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csii.ams.AmsLog;
import com.csii.ams.service.AmsLogService;
import com.csii.result.APIResult;
import com.csii.result.PageVo;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @description: 日志查询
 * @author: panChuanJiang
 * @create: 2021-03-19 16:24
 */
@Controller
@RequestMapping("/**/ams/amsLog")
public class AmsLogController  {
    @Resource
    private AmsLogService amsLogService;


    @RequestMapping("queryPageLog")
    @ResponseBody
    public APIResult<?> queryPageLog(@RequestBody AmsLog amsLog){
        Page<AmsLog> page = new Page<>(amsLog.getPageNo(),amsLog.getPageSize());
        IPage<AmsLog> amsLogIPage = amsLogService.queryPageAmsLog(page,amsLog);
        return APIResult.successResult(PageVo.getPageVoFromIPage(amsLogIPage));
    }
}
